/*
 * @Description:路由文件
 * @Author: flyer
 * @Date: 2022-04-13 17:24:40
 * @LastEditTime: 2022-04-13 23:02:38
 * @LastEditors: flyer
 */
import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import Layout from "../views/layout/index.vue";
const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    redirect: "/item",
  },
  {
    path: "/tabs",
    name: "tabs",
    component: () => import("../views/layout/index.vue"),
  },
  {
    path: "/item",
    name: "item",
    component: Layout,
    redirect: "/item1",
    children: [
      {
        path: "/home",
        name: "home",
        component: () => import("../views/business/item4/HomeView.vue"),
      },
      {
        path: "/about",
        name: "about",
        component: () => import("../views/business/item4/AboutView.vue"),
      },
      {
        path: "/item1",
        name: "item1Index",
        component: () => import("../views/business/item1/index.vue"),
      },
      {
        path: "/item2",
        name: "item2Index",
        component: () => import("../views/business/item2/index.vue"),
      },
      {
        path: "/item3",
        name: "item3Index",
        component: () => import("../views/business/item3/index.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
